# 右键执行该文件，下面环境合理
from celery_task.celery import app

from celery.result import AsyncResult


id = 'f1044ca3-6046-4941-8272-b27c2ee36b82'
if __name__ == '__main__':
    async_res = AsyncResult(id=id, app=app)
    if async_res.successful():
        result = async_res.get()
        print(result)
    elif async_res.failed():
        print('任务失败')
    elif async_res.status == 'PENDING':
        print('任务等待中被执行')
    elif async_res.status == 'RETRY':
        print('任务异常后正在重试')
    elif async_res.status == 'STARTED':
        print('任务已经开始被执行')